// 统一请求路径前缀在libs/axios.js中修改
import { getRequest, postRequest, putRequest, getNoAuthRequest, postNoAuthRequest } from '@/libs/axios';



// 文件上传接口
export const uploadFile = "/xboot/file/uploadFile"
// 验证码渲染图片接口
export const drawCodeImage = "/xboot/common/captcha/draw/"
// 获取菜单
export const getMenuList = "/xboot/permission/getMenuList"
// 获取数据字典
export const getDictData = "/xboot/dictData/getByType/"



//添加政府部门用户
export const createDepartmentUser = (params) => {
    return postRequest('/departmentUser/createDepartmentUser', params)
}

//更新政府部门用户
export const updateDepartmentUser = (params) => {
    return postRequest('/departmentUser/updateDepartmentUser', params)
}

//移除政府部门用户
export const removeDepartmentUser = (params) => {
    return postRequest('/departmentUser/removeDepartmentUser', params)
}

//获取政府部门用户列表
export const getDepartmentUserList = (params) => {
    return postRequest('/departmentUser/getDepartmentUserList', params)
}


//获取考试通过人员名单
export const getExamPassEmployeeList = (params) => {
    return postRequest('/IExamPassEmployee/getExamPassEmployeeList', params)
}

//获取考试审核列表
export const getMyExamResultConfirmCheckList = (params) => {
    return postRequest('/examResultConfirmCheck/getMyExamResultConfirmCheckList', params)
}

//审核考试结果
export const checkExamResultConfirm = (params) => {
    return postRequest('/examResultConfirmCheck/checkExamResultConfirm', params)
}

// 登陆
export const login = (params) => {
    return postNoAuthRequest('/login', params)
}
// 获取用户登录信息
export const userInfo = (params) => {
    return getRequest('/user/info', params)
}
// 注册
export const regist = (params) => {
    return postNoAuthRequest('/user/regist', params)
}
// 初始化验证码
export const initCaptcha = (params) => {
    return getNoAuthRequest('/common/captcha/init', params)
}
// IP天气信息
export const ipInfo = (params) => {
    return getRequest('/common/ip/info', params)
}
// 个人中心编辑
export const userInfoEdit = (params) => {
    return postRequest('/user/edit', params)
}
// 个人中心修改密码
export const changePass = (params) => {
    return postRequest('/user/modifyPass', params)
}
// 解锁
export const unlock = (params) => {
    return postRequest('/user/unlock', params)
}

//添加安全验收人
export const createSafetyAcceptor = (params) => {
    return postRequest('/safetyAcceptor/createSafetyAcceptor', params)
}

//移除安全验收人
export const removeSafetyAcceptor = (params) => {
    return postRequest('/safetyAcceptor/removeSafetyAcceptor', params)
}

//企业获取安全验收人列表
export const enterpriseGetSafetySecurityAdvisorList = (params) => {
    return postRequest('/safetyAcceptor/enterpriseGetSafetySecurityAdvisorList', params)
}

//安全验收人获取服务的企业列表
export const safetySecurityAdvisorGetEnterprise = (params) => {
    return postRequest('/safetyAcceptor/safetySecurityAdvisorGetEnterprise', params)
}


//创建或者更新安全得分
export const createOrUpdateScoreRecord = (params) => {
    return postRequest('/safeScoreRecord/createOrUpdateScoreRecord', params)
}

//创建或者更新企业通用参数
export const createOrUpdateEnterpriseCommonParam = (params) => {
    return postRequest('/enterpriseCommonParam/createOrUpdateEnterpriseCommonParam', params)
}

//移除企业通用参数
export const removeEnterpriseCommonParam = (params) => {
    return postRequest('/enterpriseCommonParam/removeEnterpriseCommonParam', params)
}

//获取企业通用参数列表
export const getEnterpriseCommonParamList = (params) => {
    return postRequest('/enterpriseCommonParam/getEnterpriseCommonParamList', params)
}

// 获取用户数据 多条件
export const getUserListData = (params) => {
    return getRequest('/user/getByCondition', params)
}
// 通过用户名搜索
export const searchUserByName = (username, params) => {
    return getRequest('/user/searchByName/'+username, params)
}
// 获取全部用户数据
export const getAllUserData = (params) => {
    return getRequest('/user/getAll', params)
}
// 通过部门获取全部用户数据
export const getUserByDepartmentId = (id, params) => {
    return getRequest(`/user/getByDepartmentId/${id}`, params)
}
// 添加用户
export const addUser = (params) => {
    return postRequest('/user/admin/add', params)
}
// 编辑用户
export const editUser = (params) => {
    return postRequest('/user/admin/edit', params)
}
// 启用用户
export const enableUser = (id, params) => {
    return postRequest(`/user/admin/enable/${id}`, params)
}
// 禁用用户
export const disableUser = (id, params) => {
    return postRequest(`/user/admin/disable/${id}`, params)
}
// 删除用户
export const deleteUser = (params) => {
    return postRequest('/login/removeUser', params)
}

// 重置用户密码
export const resetUserPass = (params) => {
    return postRequest('/user/resetPass', params)
}



// 获取一级部门
export const initDepartment = (params) => {
    return getRequest('/department/getByParentId/0', params)
}

// 获取一级部门
export const initDepartmentByLevel = (params) => {
    return getRequest('/department/searchByLevel/0', params)
}

// 加载部门子级数据
export const loadDepartment = (id, params) => {
    return getRequest(`/department/getByParentId/${id}`, params)
}
// 添加部门
export const addDepartment = (params) => {
    return postRequest('/department/add', params)
}
// 编辑部门
export const editDepartment = (params) => {
    return postRequest('/department/edit', params)
}
// 删除部门
export const deleteDepartment = (params) => {
    return postRequest('/department/delByIds', params)
}
// 搜索部门
export const searchDepartment = (params) => {
    return getRequest('/department/search', params)
}


// 获取一级区域
export const initArea = (params) => {
    return getRequest('/area/getByParentId/0', params)
}
// 加载部门子级数据
export const loadArea = (id, params) => {
    return getRequest(`/area/getByParentId/${id}`, params)
}
// 添加部门
export const addArea = (params) => {
    return postRequest('/area/add', params)
}
// 编辑部门
export const editArea = (params) => {
    return postRequest('/area/edit', params)
}
// 删除部门
export const deleteArea = (params) => {
    return postRequest('/area/delByIds', params)
}
// 搜索部门
export const searchArea = (params) => {
    return getRequest('/area/search', params)
}

export const getAreaByAreaLevel = (params) => {
    return postRequest('/area/getAreaByAreaLevel', params)
}

// 获取区域详情
export const getAreaById = (id, params) => {
    return getRequest(`/area/getAreaById/${id}`, params)
}


// 获取全部角色数据
export const getAllRoleList = (params) => {
    return getRequest('/role/getAllList', params)
}

export const getListByType = (params) => {
    return postRequest('/login/getListByType', params)
}
// 分页获取角色数据
export const getRoleList = (params) => {
    return getRequest('/role/getAllByPage', params)
}
// 添加角色
export const addRole = (params) => {
    return postRequest('/role/save', params)
}
// 编辑角色
export const editRole = (params) => {
    return postRequest('/role/edit', params)
}
// 设为或取消注册角色
export const setDefaultRole = (params) => {
    return postRequest('/role/setDefault', params)
}
// 分配角色权限
export const editRolePerm = (params) => {
    return postRequest('/role/editRolePerm', params)
}
// 分配角色数据权限
export const editRoleDep = (params) => {
    return postRequest('/role/editRoleDep', params)
}
// 删除角色
export const deleteRole = (params) => {
    return postRequest('/role/delByIds', params)
}

//添加安全顾问
export const createSecurityAdvisor = (params) => {
    return postRequest('/securityAdvisor/createSecurityAdvisor', params)
}
//更新安全顾问
export const updateSecurityAdvisor = (params) => {
    return postRequest('/securityAdvisor/updateSecurityAdvisor', params)
}
//移除安全顾问
export const removeSecurityAdvisor = (params) => {
    return postRequest('/securityAdvisor/removeSecurityAdvisor', params)
}
//禁用安全顾问
export const forbiddenSecurityAdvisor = (params) => {
    return postRequest('/securityAdvisor/forbiddenSecurityAdvisor', params)
}
//监管部门(企业部门)获取安全顾问列表(管理系统)
export const securityAdvisorList = (params) => {
    return postRequest('/securityAdvisor/securityAdvisorList', params)
}

//监管部门(企业部门)获取安全顾问列表(管理系统)
export const getSecurityAdvisorListByAreaId = (params) => {
    return postRequest('/securityAdvisor/getSecurityAdvisorListByAreaId', params)
}

//企业应聘安全顾问
export const createEnterpriseMessage = (params) => {
    return postRequest('/securityMessage/createEnterpriseMessage', params)
}

//企业添加用户(管理系统)
export const createEnterpriseEmployee = (params) => {
    return postRequest('/enterpriseEmployee/createEnterpriseEmployee', params)
}
//企业编辑用户
export const updateEnterpriseEmployee = (params) => {
    return postRequest('/enterpriseEmployee/updateEnterpriseEmployee', params)
}
//移除企业用户
export const removeEnterpriseEmployee = (params) => {
    return postRequest('/enterpriseEmployee/removeEnterpriseEmployee', params)
}
//禁用用户
export const forbiddenEnterpriseEmployee = (params) => {
    return postRequest('/enterpriseEmployee/forbiddenEnterpriseEmployee', params)
}

//企业给员工设置安全影响人(管理系统)
export const settingAffectedPerson = (params) => {
    return postRequest('/enterpriseEmployee/settingAffectedPerson', params)
}
//"获取我的安全影响人列表(管理系统)
export const getAffectedPersonList = (params) => {
    return postRequest('/enterpriseEmployee/getAffectedPersonList', params)
}
//移除我的安全影响人列表(管理系统)
export const removeAffectedPersonList = (params) => {
    return postRequest('/enterpriseEmployee/removeAffectedPersonList', params)
}
//企业给员工设置安全师傅(管理系统)
export const settingSafeMasterPerson = (params) => {
    return postRequest('/enterpriseEmployee/settingSafeMasterPerson', params)
}
//移除安全师傅列表(管理系统)
export const removeSafeMasterPerson = (params) => {
    return postRequest('/enterpriseEmployee/removeSafeMasterPerson', params)
}
//企业获取员工列表
export const getEnterpriseEmployeeList = (params) => {
    return postRequest('/enterpriseEmployee/getEnterpriseEmployeeList', params)
}
//设置员工是否可以离岗
export const settingEmployeeDimission = (params) => {
    return postRequest('/enterpriseEmployee/settingEmployeeDimission', params)
}
// 影响我安全的人列表
export const getAffectedPersonVoList = (params) => {
    return postRequest('/enterpriseEmployee/getAffectedPersonVoList', params)
}
// 获取我的安全师傅列表
export const getSafeMasterPerson = (params) => {
    return postRequest('/enterpriseEmployee/getSafeMasterPerson', params)
}

//企业发布需求
export const publishOrUpdateEnterpriseTrainingNeed = (params) => {
    return postRequest('/enterpriseEmployee/publishOrUpdateEnterpriseTrainingNeed', params)
}
//获取该企业发布的需求信息
export const getMyPublishEnterpriseTrainingNeedList = (params) => {
    return postRequest('/enterpriseEmployee/getMyPublishEnterpriseTrainingNeedList', params)
}
//移除企业发布的需求信息
export const removePublishEnterpriseTrainingNeed = (params) => {
    return postRequest('/enterpriseEmployee/removePublishEnterpriseTrainingNeed', params)
}

//创建或者更新岗位
export const createOrUpdateJob = (params) => {
    return postRequest('/job/createOrUpdateJob', params)
}
//移除岗位
export const removeJob = (params) => {
    return postRequest('/job/removeJob', params)
}
//获取岗位列表
export const getJobList = (params) => {
    return postRequest('/job/getJobList', params)
}
//获取指定条件的岗位
export const jobVoList = (params) => {
    return postRequest('/job/jobVoList', params)
}

// 分页获取科室数据
export const getOfficeList = (params) => {
    return getRequest('/administrativeOffice/getByPage', params)
}
// 添加或者修改科室
export const addOrUpdateOffice = (params) => {
    return postRequest('/administrativeOffice/createOrUpdateOffice', params)
}
// 删除科室
export const deleteOffice = (params) => {
    return postRequest('/administrativeOffice/removeOffice', params)
}
//根据条件或者科室列表
export const getOfficeVoList = (params) => {
    return postRequest('/administrativeOffice/getOfficeVoList', params)
}

// 获取全部权限数据
export const getAllPermissionList = (params) => {
    return getRequest('/permission/getAllList', params)
}
// 添加权限
export const addPermission = (params) => {
    return postRequest('/permission/add', params)
}
// 编辑权限
export const editPermission = (params) => {
    return postRequest('/permission/edit', params)
}
// 删除权限
export const deletePermission = (params) => {
    return postRequest('/permission/delByIds', params)
}
// 搜索权限
export const searchPermission = (params) => {
    return getRequest('/permission/search', params)
}


// 创建监管部门用户
export const createSupervisionUser = (params) => {
    return postRequest('/supervision/createSupervisionUser', params)
}
// 修改监管部门用户
export const updateSupervisionUser = (params) => {
    return postRequest('/supervision/updateSupervisionUser', params)
}
// 移除监管部门用户
export const removeSupervisionUser = (params) => {
    return postRequest('/supervision/removeSupervisionUser', params)
}
// 获取监管部门用户列表
export const getSupervisionUserList = (params) => {
    return postRequest('/supervision/getSupervisionUserList', params)
}

// 启用或者禁用监管部门用户
export const forbiddenSupervisionUser = (params) => {
    return postRequest('/supervision/forbiddenSupervisionUser', params)
}

// 获取全部岗位内容培训列表
export const getJobTrainList = (params) => {
    return postRequest('/securityAdvisorJobTrain/getJobTrainList', params)
}

// 获取岗位培训内容详情
export const getJobTrainVO = (params) => {
    return postRequest('/securityAdvisorJobTrain/getJobTrainVo', params)
}

// 添加或编辑岗位培训内容
export const createOrUpdateJobTrain = (params) => {
    return postRequest('/securityAdvisorJobTrain/createOrUpdateJobTrain', params)
}

// 移除岗位培训内容
export const removeJobTrain = (params) => {
    return postRequest('/securityAdvisorJobTrain/removeJobTrain', params)
}

// 获取企业安全顾问列表
export const getEnterpriseSecurityAdvisor = (params) => {
    return postRequest('/SecurityAdvisorServiceEnterprise/getEnterpriseSecurityAdvisor', params)
}

//移除企业安全顾问列表
export const removeEnterpriseSecurityAdvisor = (params) => {
    return postRequest('/SecurityAdvisorServiceEnterprise/removeEnterpriseSecurityAdvisor', params)
}


// 获取事故案例列表
export const getAccidentCaseList = (params) => {
    return postRequest('/IAccidentCase/getAccidentCaseList', params)
}

// 添加或更新事故案例
export const createOrUpdateAccidentCase = (params) => {
    return postRequest('/IAccidentCase/createOrUpdateAccidentCase', params)
}

// 删除事故案例
export const removeAccidentCase = (params) => {
    return postRequest('/IAccidentCase/removeAccidentCase', params)
}

// 获取法律法规列表
export const getLawAndRegulationsList = (params) => {
    return postRequest('/ILawAndRegulations/getAccidentCaseList', params)
}

// 添加或更新法律法规
export const createOrUpdateLawAndRegulations = (params) => {
    return postRequest('/ILawAndRegulations/createOrUpdateLawAndRegulations', params)
}

// 移除法律法规
export const removeLawAndRegulations = (params) => {
    return postRequest('/ILawAndRegulations/removeAccidentCase', params)
}

// 获取公告列表
export const getNoticeList = (params) => {
    return postRequest('/INotice/getNoticeList', params)
}

// 添加或更新公告
export const createOrUpdateNotice = (params) => {
    return postRequest('/INotice/createOrUpdateLawAndRegulations', params)
}

// 移除公告
export const removeNotice = (params) => {
    return postRequest('/INotice/removeNotice', params)
}

// 获取考场信息列表
export const getExamRoomList = (params) => {
    return postRequest('/IExamRoom/getExamRoomList', params)
}

// 添加或更新考场信息
export const createOrUpdateExamRoom = (params) => {
    return postRequest('/IExamRoom/createOrUpdateExamRoom', params)
}

// 移除考场信息
export const removeExamRoom = (params) => {
    return postRequest('/IExamRoom/removeExamRoom', params)
}

// 获取行业列表
export const getBusinessList = (params) => {
    return postRequest('/business/getBusinessList', params)
}

// 添加或更新行业
export const createOrUpdateBusiness = (params) => {
    return postRequest('/business/createOrUpdateBusiness', params)
}

// 移除行业
export const removeBusiness = (params) => {
    return postRequest('/business/removeBusiness', params)
}

// 获取培训分支列表
export const getTrainPartList = (params) => {
    return postRequest('/SecurityAdvisorJobTrainPart/getTrainPartList', params)
}

// 获取分支详情
export const getTrainPartVo = (params) => {
    return postRequest('/SecurityAdvisorJobTrainPart/getTrainPartVo', params)
}

// 添加或者更新培训分支
export const createOrUpdateTrainPart = (params) => {
    return postRequest('/SecurityAdvisorJobTrainPart/createOrUpdateTrainPart', params)
}

// 移除培训分支
export const removeTrainPart = (params) => {
    return postRequest('/SecurityAdvisorJobTrainPart/removeTrainPart', params)
}

// 获取安全顾问正在服务的公司列表
export const getServiceEnterpriseUser = (params) => {
    return postRequest('/SecurityAdvisorServiceEnterprise/getServiceEnterpriseUser', params)
}

// 获取某个公司的岗位列表
export const getJobVoListByEnterpriseId = (params) => {
    return postRequest('/job/getJobVoListByEnterpriseId', params)
}

// 获取违章记录（安全顾问）
export const getBreakRoleRecordList = (params) => {
    return postRequest('/breakRolesRecord/getBreakRoleRecordList', params)
}

// 获取违章记录详情（安全顾问）
export const getBreakRoleRecordDetail = (params) => {
    return postRequest('/breakRolesRecord/getBreakRoleRecordDetail', params)
}

// 添加或者更新违章记录
export const createOrUpdateBreakRoleRecord = (params) => {
    return postRequest('/breakRolesRecord/createOrUpdateBreakRoleRecord', params)
}

// 移除违章记录
export const removeBreakRoleRecord = (params) => {
    return postRequest('/breakRolesRecord/removeBreakRoleRecord', params)
}

// 根据企业id获取员工列表
export const getBackEnterpriseEmployeeList = (params) => {
    return postRequest('/enterpriseEmployee/getBackEnterpriseEmployeeList', params)
}

// (安全顾问)获取隐患记录列表
export const getHiddenDangerRecordList = (params) => {
    return postRequest('/hiddenDangerRecord/getHiddenDangerRecordList', params)
}

// (安全顾问)获取隐患记录详情
export const getHiddenDangerRecordDetail = (params) => {
    return postRequest('/hiddenDangerRecord/getHiddenDangerRecordDetail', params)
}

// 添加或者更新隐患记录
export const createOrUpdateHiddenDangerRecord = (params) => {
    return postRequest('/hiddenDangerRecord/createOrUpdateHiddenDangerRecord', params)
}

// 移除隐患记录
export const removeHiddenDangerRecord = (params) => {
    return postRequest('/hiddenDangerRecord/removeHiddenDangerRecord', params)
}

// 添加或者编辑考试试题
export const createOrUpdateExamContent = (params) => {
    return postRequest('/SecurityAdvisorExamContent/createOrUpdateExamContent', params)
}

// 移除考试试题
export const removeExamContent = (params) => {
    return postRequest('/SecurityAdvisorExamContent/removeExamContent', params)
}

// 获取考试内容详情
export const getExamContentVo = (params) => {
    return postRequest('/SecurityAdvisorExamContent/getExamContentVo', params)
}

// 获取考试试题列表
export const getExamContentList = (params) => {
    return postRequest('/SecurityAdvisorExamContent/getExamContentList', params)
}

// 根据企业id获取岗位事故案例列表
export const getJobAccidentByEnterpriseId = (params) => {
    return postRequest('/jobAccidentCase/getJobAccidentByEnterpriseId', params)
}

// (安全顾问)获取岗位事故案例列表(管理系统)
export const getJobAccidentCaseList = (params) => {
    return postRequest('/jobAccidentCase/getJobAccidentCaseList', params)
}



// 添加或者更新企业岗位事故案例
export const createOrUpdateJobAccidentCase = (params) => {
    return postRequest('/jobAccidentCase/createOrUpdateJobAccidentCase', params)
}

// 移除企业岗位事故案例
export const removeJobAccidentCase = (params) => {
    return postRequest('/jobAccidentCase/removeJobAccidentCase', params)
}

// 分页获取职务列表
export const getPositionList = (params) => {
    return postRequest('/duty/getByPage', params)
}

// 获取全部职务列表
export const getAllPositionList = (params) => {
    return postRequest('/duty/dutyVoList', params)
}

// 添加或更新职务列表
export const createOrUpdateDuty = (params) => {
    return postRequest('/duty/createOrUpdateDuty', params)
}

// 移除职务
export const removeDuty = (params) => {
    return postRequest('/duty/removeDuty', params)
}

// 获取全部字典
export const getAllDictList = (params) => {
    return getRequest('/dict/getAll', params)
}
// 添加字典
export const addDict = (params) => {
    return postRequest('/dict/add', params)
}
// 编辑字典
export const editDict = (params) => {
    return postRequest('/dict/edit', params)
}
// 删除字典
export const deleteDict = (params) => {
    return postRequest('/dict/delByIds', params)
}
// 搜索字典
export const searchDict = (params) => {
    return getRequest('/dict/search', params)
}
// 获取全部字典数据
export const getAllDictDataList = (params) => {
    return getRequest('/dictData/getByCondition', params)
}
// 添加字典数据
export const addDictData = (params) => {
    return postRequest('/dictData/add', params)
}
// 编辑字典数据
export const editDictData = (params) => {
    return postRequest('/dictData/edit', params)
}
// 删除字典数据
export const deleteData = (params) => {
    return postRequest('/dictData/delByIds', params)
}
// 通过类型获取字典数据
export const getDictDataByType = (type, params) => {
    return getRequest(`/dictData/getByType/${type}`, params)
}



// 分页获取日志数据
export const getLogListData = (params) => {
    return getRequest('/log/getAllByPage', params)
}
// 删除日志
export const deleteLog = (params) => {
    return postRequest('/log/delByIds', params)
}
// 清空日志
export const deleteAllLog = (params) => {
    return postRequest('/log/delAll', params)
}


// 分页获取Redis数据
export const getRedisData = (params) => {
    return getRequest('/redis/getAllByPage', params)
}
// 通过key获取Redis信息
export const getRedisByKey = (key, params) => {
    return getRequest(`/redis/getByKey/${key}`, params)
}
// 获取Redis键值数量
export const getRedisKeySize = (params) => {
    return getRequest('/redis/getKeySize', params)
}
// 获取Redis内存
export const getRedisMemory = (params) => {
    return getRequest('/redis/getMemory', params)
}
// 获取Redis信息
export const getRedisInfo = (params) => {
    return getRequest('/redis/info', params)
}
// 添加编辑Redis
export const saveRedis = (params) => {
    return postRequest('/redis/save', params)
}
// 删除Redis
export const deleteRedis = (params) => {
    return postRequest('/redis/delByKeys', params)
}
// 清空Redis
export const deleteAllRedis = (params) => {
    return postRequest('/redis/delAll', params)
}



// 分页获取定时任务数据
export const getQuartzListData = (params) => {
    return getRequest('/quartzJob/getAllByPage', params)
}
// 添加定时任务
export const addQuartz = (params) => {
    return postRequest('/quartzJob/add', params)
}
// 编辑定时任务
export const editQuartz = (params) => {
    return postRequest('/quartzJob/edit', params)
}
// 暂停定时任务
export const pauseQuartz = (params) => {
    return postRequest('/quartzJob/pause', params)
}
// 恢复定时任务
export const resumeQuartz = (params) => {
    return postRequest('/quartzJob/resume', params)
}
// 删除定时任务
export const deleteQuartz = (params) => {
    return postRequest('/quartzJob/delByIds', params)
}

// base64上传
export const base64Upload = (params) => {
    return postRequest('/upload/file', params)
}
